//
//  PlanUpLoadController.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/10.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "PlanUpLoadController.h"
#import "PlanUpTureController.h"


@interface PlanUpLoadController ()
@property (weak, nonatomic) IBOutlet UIImageView *YHImage;
@property (weak, nonatomic) IBOutlet UILabel *YHName;
@property (weak, nonatomic) IBOutlet UILabel *YHNumb;

@end

@implementation PlanUpLoadController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    self.navigationItem.title = @"确认提交";
    [self.YHImage sd_setImageWithURL:[NSURL URLWithString:self.CardModel.card_icon] placeholderImage:[UIImage imageNamed:@"MainZWImage"]];
    self.YHName.text = [NSString stringWithFormat:@"%@",self.CardModel.card_name];
    self.YHNumb.text = [NSString stringWithFormat:@"尾号%@",self.CardModel.card_number];
}
- (IBAction)ClickOnBtnToUpLoadPlan:(id)sender {
    
    NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
    [dic setObject:self.CardModel.card_id forKey:@"card_id"];
    [dic setObject:KUserID forKey:@"card_member"];
    [dic setObject:self.SNNumb forKey:@"card_order"];
    
    [MainObjectWay PostWithMethod:@"sure" andAction:@"Creditcard" andAddParam:YES parameters:dic success:^(id responseObject) {
        NSLog(@"返回的信息 = %@",responseObject);
        if ([MainObjectWay IsSucceedWithCode:responseObject[@"code"]]) {
            PlanUpTureController * UpC = [[PlanUpTureController alloc] init];
            [self.navigationController pushViewController:UpC animated:YES];
        }else{
            [MBProgressHUD showAlertViewWithText:@"上传信息有误"];
        }
    } failure:^(NSError *error) {
        [MBProgressHUD showAlertViewWithText:@"上传信息失败"];
        NSLog(@"错误信息 = %@",error);
    }];
    
    
    
    
   
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
